package pers.cj.pdos.controller.init;

import pers.cj.pdos.entity.Menu1;
import pers.cj.pdos.entity.Menu2;
import pers.cj.pdos.entity.Menu3;
import pers.cj.pdos.service.IMenu1Service;
import pers.cj.pdos.service.IMenu2Service;
import pers.cj.pdos.service.IMenu3Service;
import pers.cj.pdos.utils.UuidUtils;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class InitMenu {
    public void init(IMenu1Service menu1Service, IMenu2Service menu2Service, IMenu3Service menu3Service) {
        if (menu1Service.count() > 0) {
            return;
        }

        List<Menu1> menu1s = new ArrayList<>();
        List<Menu2> menu2s = new ArrayList<>();
        List<Menu3> menu3s = new ArrayList<>();

        //1级菜单
        Menu1 xjgh = new Menu1(UuidUtils.getUUID(),"销进管货", new Date(), 1,"fa fa-bandcamp");
        menu1s.add(xjgh);
        Menu1 cwgz = new Menu1(UuidUtils.getUUID(),"财务管帐", new Date(), 2,"fa fa-google-wallet");
        menu1s.add(cwgz);
        Menu1 kggl = new Menu1(UuidUtils.getUUID(),"客供管理", new Date(), 3,"fa fa-vcard");
        menu1s.add(kggl);
        Menu1 sjfx = new Menu1(UuidUtils.getUUID(),"数据分析", new Date(), 4,"fa fa-area-chart");
        menu1s.add(sjfx);
        Menu1 yxgl = new Menu1(UuidUtils.getUUID(),"营销管理", new Date(), 5,"fa fa-buysellads");
        menu1s.add(yxgl);
        Menu1 jczl = new Menu1(UuidUtils.getUUID(),"基础资料", new Date(), 6,"fa fa-cube");
        menu1s.add(jczl);
        Menu1 xtsz = new Menu1(UuidUtils.getUUID(),"系统设置", new Date(), 7,"fa fa-cogs");
        menu1s.add(xtsz);

        //2级菜单
        Menu2 xs = new Menu2(UuidUtils.getUUID(),"销售", new Date(), 1, xjgh.getId(),"fa fa-money");
        menu2s.add(xs);
        Menu2 jh = new Menu2(UuidUtils.getUUID(),"进货", new Date(), 2, xjgh.getId(),"fa fa-inbox");
        menu2s.add(jh);
        Menu2 kc = new Menu2(UuidUtils.getUUID(),"库存", new Date(), 3, xjgh.getId(),"fa fa-truck");
        menu2s.add(kc);

        Menu2 sz = new Menu2(UuidUtils.getUUID(),"收支", new Date(), 1, cwgz.getId(),"fa fa-building");
        menu2s.add(sz);
        Menu2 zjwl = new Menu2(UuidUtils.getUUID(),"资金往来", new Date(), 2, cwgz.getId(),"fa fa-exchange");
        menu2s.add(zjwl);

        Menu2 kh = new Menu2(UuidUtils.getUUID(),"客户", new Date(), 1, kggl.getId(),"fa fa-id-badge");
        menu2s.add(kh);
        Menu2 gys = new Menu2(UuidUtils.getUUID(),"供应商", new Date(), 2, kggl.getId(),"fa fa-handshake-o");
        menu2s.add(gys);

        Menu2 sptj = new Menu2(UuidUtils.getUUID(),"商品统计", new Date(), 1, sjfx.getId(),"fa fa-gift");
        menu2s.add(sptj);
        Menu2 cwtj = new Menu2(UuidUtils.getUUID(),"财务统计", new Date(), 2, sjfx.getId(),"fa fa-sitemap");
        menu2s.add(cwtj);


        Menu2 sp = new Menu2(UuidUtils.getUUID(),"商品", new Date(), 1, yxgl.getId(),"fa fa-gift");
        menu2s.add(sp);
        Menu2 spzl = new Menu2(UuidUtils.getUUID(),"商品资料", new Date(), 1, jczl.getId(),"fa fa-gift");
        menu2s.add(spzl);
        Menu2 sfkzh = new Menu2(UuidUtils.getUUID(),"收付款账户", new Date(), 2, jczl.getId(),"fa fa-address-book");
        menu2s.add(sfkzh);
        Menu2 jggl = new Menu2(UuidUtils.getUUID(),"机构管理", new Date(), 3, jczl.getId(),"fa fa-bank");
        menu2s.add(jggl);


        Menu2 cssz = new Menu2(UuidUtils.getUUID(),"参数设置", new Date(), 1, xtsz.getId(),"fa fa-cog");
        menu2s.add(cssz);
        Menu2 yggl = new Menu2(UuidUtils.getUUID(),"员工管理", new Date(), 2, xtsz.getId(),"fa fa-user");
        menu2s.add(yggl);
        Menu2 wdzh = new Menu2(UuidUtils.getUUID(),"我的账户", new Date(), 3, xtsz.getId(),"fa fa-address-book");
        menu2s.add(wdzh);

        //3级菜单
        //销售
        Menu3 saleOrder = new Menu3(UuidUtils.getUUID(),"销售订单",1, 0, "/sale/saleOrder",new Date(),xs.getId(),"fa fa-list-alt","_self","saleOrder");
        menu3s.add(saleOrder);
        Menu3 sale = new Menu3(UuidUtils.getUUID(),"销售",2, 0, "/sale/sale",new Date(),xs.getId(),"fa fa-sign-in","_self","sale");
        menu3s.add(sale);
        Menu3 refund = new Menu3(UuidUtils.getUUID(),"销售退货",3, 0, "/sale/refund",new Date(),xs.getId(),"fa fa-sign-out","_self","refund");
        menu3s.add(refund);

        Menu3 retail = new Menu3(UuidUtils.getUUID(),"零售收银",3, 0, "/sale/retail",new Date(),xs.getId(),"fa fa-cny","_blank","retail");
        menu3s.add(retail);

        //进货
        Menu3 inGoodsOrder = new Menu3(UuidUtils.getUUID(),"进货订单",1, 0, "/inGoods/inGoodsOrder",new Date(),jh.getId(),"fa fa-window-maximize","_self","inGoodsOrder");
        menu3s.add(inGoodsOrder);
        Menu3 inGoods = new Menu3(UuidUtils.getUUID(),"进货",2, 0, "/inGoods/inGoods",new Date(),jh.getId(),"fa fa-plus-square","_self","inGoods");
        menu3s.add(inGoods);
        Menu3 inGoodsRefund = new Menu3(UuidUtils.getUUID(),"进货退货",3, 0, "/inGoods/inGoodsRefund",new Date(),jh.getId(),"fa fa-minus-square","_self","inGoodsRefund");
        menu3s.add(inGoodsRefund);

        //库存
        Menu3 checkHouse = new Menu3(UuidUtils.getUUID(),"库存盘点",1, 0, "/house/checkHouse",new Date(),kc.getId(),"fa fa-calculator","_self","checkHouse");
        menu3s.add(checkHouse);
        Menu3 joinSplit = new Menu3(UuidUtils.getUUID(),"组装拆卸",2, 0, "/house/joinSplit",new Date(),kc.getId(),"fa fa-cogs","_self","joinSplit");
        menu3s.add(joinSplit);
        Menu3 goodsTransfer = new Menu3(UuidUtils.getUUID(),"调拨单",3, 0, "/house/goodsTransfer",new Date(),kc.getId(),"fa fa-adjust","_self","goodsTransfer");
        menu3s.add(goodsTransfer);
        Menu3 houseIn = new Menu3(UuidUtils.getUUID(),"入库",5, 0, "/house/houseInMain",new Date(),kc.getId(),"fa fa-forward","_self","houseIn");
        menu3s.add(houseIn);
        Menu3 houseOut = new Menu3(UuidUtils.getUUID(),"出库",7, 0, "/house/houseOutMain",new Date(),kc.getId(),"fa fa-backward","_self","houseOut");
        menu3s.add(houseOut);
        Menu3 borrowIn = new Menu3(UuidUtils.getUUID(),"借入",8, 0, "/house/borrowIn",new Date(),kc.getId(),"fa fa-plus-square","_self","borrowIn");
        menu3s.add(borrowIn);
        Menu3 borrowOut = new Menu3(UuidUtils.getUUID(),"借出",9, 0, "/house/borrowOut",new Date(),kc.getId(),"fa fa-minus-square","_self","borrowOut");
        menu3s.add(borrowOut);
        Menu3 houseQuery = new Menu3(UuidUtils.getUUID(),"库存查询",10, 0, "/house/houseQuery",new Date(),kc.getId(),"fa fa-search-plus","_self","houseQuery");
        menu3s.add(houseQuery);
        Menu3 goodsSn = new Menu3(UuidUtils.getUUID(),"序列号查询",11, 0, "/house/goodsSn",new Date(),kc.getId(),"fa fa-barcode","_self","goodsSn");
        menu3s.add(goodsSn);

        //收支
        Menu3 budget = new Menu3(UuidUtils.getUUID(),"日常收支",1, 0, "/budget/budget",new Date(),sz.getId(),"fa fa-cny","_self","budget");
        menu3s.add(budget);
        Menu3 budgetProject = new Menu3(UuidUtils.getUUID(),"收支项目",3, 0, "/budget/budgetProject",new Date(),sz.getId(),"fa fa-book","_self","budgetProject");
        menu3s.add(budgetProject);

        //资金往来
        Menu3 arrearsOrder = new Menu3(UuidUtils.getUUID(),"应收款",1, 0, "/funds/arrearsWait",new Date(),zjwl.getId(),"fa fa-arrows-h","_self","arrearsOrder");
        menu3s.add(arrearsOrder);
        Menu3 payOrder = new Menu3(UuidUtils.getUUID(),"应付款",2, 0, "/funds/payWait",new Date(),zjwl.getId(),"fa fa-arrows-v","_self","payOrder");
        menu3s.add(payOrder);
        Menu3 moneyWater = new Menu3(UuidUtils.getUUID(),"资金流水",3, 0, "/funds/moneyWater",new Date(),zjwl.getId(),"fa fa-bars","_self","moneyWater");
        menu3s.add(moneyWater);
        Menu3 transfer = new Menu3(UuidUtils.getUUID(),"账户转账",4, 0, "/funds/transfer",new Date(),zjwl.getId(),"fa fa-clipboard","_self","transfer");
        menu3s.add(transfer);
        Menu3 saleTicket = new Menu3(UuidUtils.getUUID(),"销售开票",3, 0, "/funds/saleTicket",new Date(),zjwl.getId(),"fa fa-bars","_self","saleTicket");
        menu3s.add(saleTicket);

        //客户
        Menu3 custom = new Menu3(UuidUtils.getUUID(),"客户管理",1, 0, "/custom/custom",new Date(),kh.getId(),"fa fa-address-card","_self","custom");
        menu3s.add(custom);
        Menu3 customType = new Menu3(UuidUtils.getUUID(),"客户分类",2, 0, "/custom/customType",new Date(),kh.getId(),"fa fa-certificate","_self","customType");
        menu3s.add(customType);

        //供应商
        Menu3 provider = new Menu3(UuidUtils.getUUID(),"供应商管理",1, 0, "/provider/provider",new Date(),gys.getId(),"fa fa-handshake-o","_self","provider");
        menu3s.add(provider);
        Menu3 providerType = new Menu3(UuidUtils.getUUID(),"供应商分类",2, 0, "/provider/providerType",new Date(),gys.getId(),"fa fa-certificate","_self","providerType");
        menu3s.add(providerType);

        //商品统计
        Menu3 saleAnalysis = new Menu3(UuidUtils.getUUID(),"销售报表",1, 0, "/goodsCount/saleAnalysis",new Date(),sptj.getId(),"fa fa-area-chart","_self","saleAnalysis");
        menu3s.add(saleAnalysis);
        Menu3 refundAnalysis = new Menu3(UuidUtils.getUUID(),"销售退货报表",2, 0, "/goodsCount/refundAnalysis",new Date(),sptj.getId(),"fa fa-bar-chart","_self","refundAnalysis");
        menu3s.add(refundAnalysis);
        Menu3 inGoodsAnalysis = new Menu3(UuidUtils.getUUID(),"进货报表",3, 0, "/goodsCount/inGoodsAnalysis",new Date(),sptj.getId(),"fa fa-bar-chart","_self","inGoodsAnalysis");
        menu3s.add(inGoodsAnalysis);
        Menu3 inGoodsRefundAnalysis = new Menu3(UuidUtils.getUUID(),"进货退货报表",4, 0, "/goodsCount/inGoodsRefundAnalysis",new Date(),sptj.getId(),"fa fa-bar-chart","_self","inGoodsRefundAnalysis");
        menu3s.add(inGoodsRefundAnalysis);

        //财务统计
        Menu3 operateAnalysis = new Menu3(UuidUtils.getUUID(),"经营状况报告",1, 0, "/financeCount/operateAnalysis",new Date(),cwtj.getId(),"fa fa-bar-chart-o","_self","operateAnalysis");
        menu3s.add(operateAnalysis);
        Menu3 profitAnalysis = new Menu3(UuidUtils.getUUID(),"利润报表",2, 0, "/financeCount/profitAnalysis",new Date(),cwtj.getId(),"fa fa-line-chart","_self","profitAnalysis");
        menu3s.add(profitAnalysis);
        Menu3 performanceAnalysis = new Menu3(UuidUtils.getUUID(),"业绩报表",3, 0, "/financeCount/performanceAnalysis",new Date(),cwtj.getId(),"fa fa-pie-chart","_self","performanceAnalysis");
        menu3s.add(performanceAnalysis);

        //商品
        Menu3 goodsPacket = new Menu3(UuidUtils.getUUID(),"商品套餐",1, 0, "/marketGoods/packet",new Date(),sp.getId(),"fa fa-cc","_self","packet");
        menu3s.add(goodsPacket);
        Menu3 goodsTemplate = new Menu3(UuidUtils.getUUID(),"商品模板",2, 0, "/marketGoods/goodsTemplate",new Date(),sp.getId(),"fa fa-window-maximize","_self","goodsTemplate");
        menu3s.add(goodsTemplate);

        //商品资料
        Menu3 goods = new Menu3(UuidUtils.getUUID(),"商品列表",2, 0, "/goods/goods",new Date(),spzl.getId(),"fa fa-list","_self","goods");
        menu3s.add(goods);
        Menu3 type = new Menu3(UuidUtils.getUUID(),"商品分类",3, 0, "/goods/type",new Date(),spzl.getId(),"fa fa-certificate","_self","type");
        menu3s.add(type);
        Menu3 attr = new Menu3(UuidUtils.getUUID(),"属性设置",4, 0, "/goods/attr",new Date(),spzl.getId(),"fa fa-adn","_self","attr");
        menu3s.add(attr);
        Menu3 unit = new Menu3(UuidUtils.getUUID(),"单位设置",5, 0, "/goods/unit",new Date(),spzl.getId(),"fa fa-balance-scale","_self","unit");
        menu3s.add(unit);

        //收付款账户
        Menu3 settAccount = new Menu3(UuidUtils.getUUID(),"结算账户",1, 0, "/settAccount/settAccount",new Date(),sfkzh.getId(),"fa fa-book","_self","settAccount");
        menu3s.add(settAccount);

        //机构管理
        Menu3 store = new Menu3(UuidUtils.getUUID(),"门店管理",1, 0, "/organization/store",new Date(),jggl.getId(),"fa fa-hospital-o","_self","store");
        menu3s.add(store);
        Menu3 house = new Menu3(UuidUtils.getUUID(),"仓库管理",2, 0, "/organization/house",new Date(),jggl.getId(),"fa fa-stop","_self","house");
        menu3s.add(house);

        //参数设置
        Menu3 businessSet = new Menu3(UuidUtils.getUUID(),"业务设置",1, 0, "/sett/businessSet",new Date(),cssz.getId(),"fa fa-caret-square-o-up","_self","businessSet");
        menu3s.add(businessSet);
        Menu3 retailSet = new Menu3(UuidUtils.getUUID(),"零售收银设置",1, 0, "/sett/retailSet",new Date(),cssz.getId(),"fa fa-cny","_self","retailSet");
        menu3s.add(retailSet);
        Menu3 orderRule = new Menu3(UuidUtils.getUUID(),"单号规则",2, 0, "/sett/orderRule",new Date(),cssz.getId(),"fa fa-navicon","_self","orderRule");
        menu3s.add(orderRule);
        Menu3 init = new Menu3(UuidUtils.getUUID(),"初期信息",3, 0, "/sett/initInfo",new Date(),cssz.getId(),"fa fa-Example of print","_self","initInfo");
        menu3s.add(init);

        //员工管理
        Menu3 user = new Menu3(UuidUtils.getUUID(),"员工管理",1, 0, "/user/user",new Date(),yggl.getId(),"fa fa-user-circle","_self","user");
        menu3s.add(user);
//        Menu3 shopGuide = new Menu3(UuidUtils.getUUID(),"导购员管理",2, 0, "/user/shopGuide",new Date(),yggl.getId(),"fa fa-user-o","");
//        menu3s.add(shopGuide);
        Menu3 role = new Menu3(UuidUtils.getUUID(),"角色管理",3, 0, "/user/role",new Date(),yggl.getId(),"fa fa-address-book-o","_self","role");
        menu3s.add(role);

        //我的账户
        Menu3 company = new Menu3(UuidUtils.getUUID(),"企业资料",1, 0, "/account/company",new Date(),wdzh.getId(),"fa fa-building","_self","company");
        menu3s.add(company);

        menu1Service.insertBatch(menu1s);
        menu2Service.insertBatch(menu2s);
        menu3Service.insertBatch(menu3s);
    }
}
